export default {
  config: {
    host: '49.51.193.79',
    port: 6379,
    password: 'jsz04005301',
    db: 2,
    retryStrategy: (times: number) => {
      if (times > 5) {
        return null;
      }
      return Math.min(times * 2000, 10000);
    },
    connectTimeout: 60000,
    maxRetriesPerRequest: 5,
    enableReadyCheck: true,
    // 增加心跳检测
    keepAlive: 30000,
    reconnectOnError: (err) => {
      const targetError = 'READONLY';
      if (err.message.includes(targetError)) {
        return true;
      }
      return false;
    },
    commandTimeout: 300000, // 5 minutes
  },
  // 连接池配置
  settings: {
    max: 30,
    min: 10,
    acquire: 60000,
    idle: 30000
  }
}